|
|
@@ -91,14 +91,14 @@ def bind_eqpt(request):
|
91
|
91
|
ipui = IsolationPointUserInfo.objects.get(user_id=user_id, status=True)
|
92
|
92
|
except IsolationPointUserInfo.DoesNotExist:
|
93
|
93
|
return response(IsolationPointStatusCode.ISOLATIONPOINT_USER_NOT_FOUND)
|
94
|
|
-
|
|
94
|
+
|
95
|
95
|
# 清除之前绑定的设备
|
96
|
|
- ThermometerEquipmentInfo.objects.filter(ipui_pk=ipui.pk).update(active_status=ThermometerEquipmentInfo.OFFLINE)
|
|
96
|
+ ThermometerEquipmentInfo.objects.filter(ipui_pk=ipui.pk).update(ipui_pk=0, active_status=ThermometerEquipmentInfo.OFFLINE)
|
97
|
97
|
|
98
|
98
|
ThermometerEquipmentInfo.objects.update_or_create(macid=macid, defaults={
|
99
|
99
|
'point_id': ipui.point_id,
|
100
|
100
|
'ipui_pk': ipui.pk,
|
101
|
|
- 'active_status': True,
|
|
101
|
+ 'active_status': ThermometerEquipmentInfo.ONLINE,
|
102
|
102
|
'active_at': tc.utc_datetime()
|
103
|
103
|
})
|
104
|
104
|
|